/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cnam.mobileShopping.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Administrateur
 */
@Entity
@Table(name = "mList")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MList.findAll", query = "SELECT l FROM MList l"),
    @NamedQuery(name = "MList.findByMListid", query = "SELECT l FROM MList l WHERE l.mlistid = :listid"),
    @NamedQuery(name = "MList.findByCommonMListid", query = "SELECT l FROM MList l WHERE l.commonid = :commonlistid"),
    @NamedQuery(name = "MList.findByLabel", query = "SELECT l FROM MList l WHERE l.label = :label"),
    @NamedQuery(name = "MList.findByCreatedatetime", query = "SELECT l FROM MList l WHERE l.createdatetime = :createdatetime"),
    @NamedQuery(name = "MList.findByStatus", query = "SELECT l FROM MList l WHERE l.status = :status")})
@XmlAccessorType(XmlAccessType.FIELD)
public class MList implements Serializable {

    private static final long serialVersionUID = -7782349946947169235L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "mlistid")
    private Integer mlistid;
    
    @Column(name = "label")
    private String label;
    
    @Column(name = "createdatetime")
    @Temporal(TemporalType.DATE)   
    private Date createdatetime;
    
    @Column(name = "status")
    private Short status;

    @Column(name="commonid")
    private String commonid;

    @Column(name="version")
    private int version;

    public int getVersion() {
        return version;
    }

    public void setVersion(int version) {
        this.version = version;
    }
    
    public String getCommonid() {
        return commonid;
    }

    public void setCommonid(String commonid) {
        this.commonid = commonid;
    }
    
    public Integer getMlistid() {
        return mlistid;
    }

    public void setMlistid(Integer mlistid) {
        this.mlistid = mlistid;
    }

    public MList() {
    }

    public MList(Integer listid) {
        this.mlistid = listid;
    }

    public String getLabel() {
        return label;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public Date getCreatedatetime() {
        return createdatetime;
    }

    public void setCreatedatetime(Date createdatetime) {
        this.createdatetime = createdatetime;
    }

    public Short getStatus() {
        return status;
    }

    public void setStatus(Short status) {
        this.status = status;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mlistid != null ? mlistid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MList)) {
            return false;
        }
        MList other = (MList) object;
        if ((this.mlistid == null && other.mlistid != null) || (this.mlistid != null && !this.mlistid.equals(other.mlistid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cnam.mobileShopping.entity.MList[ mlistid=" + mlistid + " ]";
    }
}
